<%@ page language="java" pageEncoding="UTF-8"%><%@ include
	file="/WEB-INF/commons/taglibs.jsp"%>
<script type="text/javascript">
function showMsg($item, msgType, msg, timeout){
	var classType='ui-state-highlight';
	if(msgType=='error'){
		classType='ui-state-error';
	}
	$item.addClass(classType);
	$item.html("<span class='ui-icon ui-icon-info' style='float: left; margin-right: .3em;'></span>"+msg);
	setTimeout(function(){$item.html('').removeClass(classType);},timeout);
}
$(function(){
	$('.flow-add').click(function(){
		$.ajax({
			url: '/public/subscribe?'+$(this).attr('flowId'),
			type: 'GET',
			timeout: 15000,
			error: function(){showMsg($('#message'),'error','电话订阅失败!',3000);},
			success: function(response){
				if(response.search('ERROR')!=-1){
					var msg=response.substring(5);
					showMsg($('#message'),'error','电话订阅失败!'+msg,3000);
				}else{
					showMsg($('#message'),'info','电话订阅成功!',3000);
				}
			}
		});
	});
	$('.flow-share').click(function(){window.alert('share');});
});
</script>
<!-- Flow展示区 -->
<table>
	<tr>
		<td>
		<div id="left" class="top-border">
		<p class="title">最新共享</p>
		<c:forEach var="e" items="${it.flows}">
			<div class="nodeData">
			<div class="nodeData_title">${e.name}<!-- &nbsp;<a href="#"
				title="分享给好友" flowId="${e.id}"
				class="ui-icon ui-icon-signal-diag flow-share">分享给好友</a> -->&nbsp;<a
				href="#" title="加入我的电话" flowId="${e.id}"
				class="ui-icon ui-icon-check flow-add">加入我的电话</a>&nbsp;</div>
			<div class="nodeData_content">${e.content}</div>
			<div class="nodeData_bottom"><font><c:choose>
				<c:when test="${not empty e.owner}">${e.owner}</c:when>
				<c:otherwise>anonymous</c:otherwise>
			</c:choose></font>&nbsp;&nbsp;<fmt:formatDate value="${e.crtDate}"
				pattern="MM-dd HH:mm:ss" /></div>
			</div>
		</c:forEach></div>
		</td>
		<td>
		<div id="right" class="top-border">
		<div class="navContainer">
		<p class="title">所有电话分类</p>
		<ul>
			<li>
			<p class="name"></p>
			</li>
		</ul>
		</div>
		</div>
		</td>
	</tr>
</table>